import React from 'react';
import './App.css';
import LayoutIndex from '@pages/layout';

import { Provider } from 'react-redux'
import { store } from './store'

import Login from '@pages/login';
import Page404 from '@pages/404';


import {HashRouter as Router, Route, Switch } from 'react-router-dom';



function App() {
  console.log(store.getState().base.routerData)
  const { routerData } = store.getState().base
  const routerDataHtml = routerData.map( (item,index) => {
    return (
      <Route path={ item.path } exact component={ LayoutIndex } key={index}/>
    )
  })
  return (
    <Provider store={store}>
     
      <div className="App">
        <Router>
            {/* <Switch>
              { routerDataHtml }
              <Route path="/system" exact component={ LayoutIndex }/>
              <Route path="/login" exact component={ Login}/>
              <Route path="*" component={ Page404 }/>
            </Switch> */}
            <LayoutIndex></LayoutIndex>
        </Router>
       
      </div>
    </Provider>
  );
}

export default App